import request  from "@/utils/request.js";

export const getAllCategory = () => {
    return request({
        url: '/admin/category/getAllCategory',
        method: 'get',
    });
}

export const deleteCategoryByName = (categoryName) => {
    return request({
        url: '/admin/category/deleteCategory',
        method: 'delete',
        params: { categoryName }
    });
}

export const updateCategory = (category) => {
    return request({
        url: '/admin/category/updateCategory',
        method: 'put',
        data: category
    });
}

export const addCategoryFunc = (categoryName) => {
    return request({
        url: '/admin/category/addCategory',
        method: 'post',
        params: { categoryName }
    });
}